<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="tag" uri="com.sand.myTag" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/layui/lib/layui-v2.6.3/css/layui.css" media="all">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/layui/css/public.css" media="all">
    <style>
        body {
            background-color: #ffffff;
        }
    </style>
</head>
<body>
<% int num=0; %>
<div class="layui-form layuimini-form">
<c:forEach items="${list}" var="ite">
        <div class="layui-form-item">
            <label class="layui-form-label"><%=++num%></label>
            <div class="layui-input-inline">
<%--                    ${ite.housePicture}--%>
                <img alt="暂未上传" src="${pageContext.request.contextPath}/renting/img/${ite.housePicture}" style="width: 100px;height: 50px">
            </div>
            <div class="layui-input-inline">
                <input type="text" disabled value="${ite.communityName}" class="layui-input" style="width: 300px;text-align: center;">
            </div>
        </div>
    <hr/>
</c:forEach>
</div>


<script src="${pageContext.request.contextPath}/layui/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
<script src="${pageContext.request.contextPath}/layui/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
<script>
    layui.use(['form', 'tableSelect', 'table', 'laydate'], function () {
        var form = layui.form,
            layer = layui.layer,
            tableSelect = layui.tableSelect,
            laydate = layui.laydate,
            $ = layui.$;

        //监听提交
        form.on('submit(delete)', function (data) {
            $.ajax({
                url:"${pageContext.request.contextPath}/question/delQuestionDetails",
                type:"post",
                data:"data="+JSON.stringify(data.field),
                dataType:"text",
                success:(rs)=>{
                    if(rs=="OK"){
                        layer.msg("删除成功",{icon:1,time:500},function (){
                            window.location.href="${pageContext.request.contextPath}/question/queryQuestionById?showWi=1&rid="+${obj.rid};
                        })
                    }else{
                        layer.msg("删除失败",{icon:2,time:500})
                    }
                }
            })
            return false;
        });
    });
</script>
</body>
</html>